﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminManage.ascx.cs" Inherits="NLLSite.Administrator.UserControl.AdminManage" %>

<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý tài khoản</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                
<asp:Panel ID="Panel1" runat="server" 
    Visible="False">
    <table>
        <tr>
            <td>Tài khoản: </td>
            <td>
                <asp:TextBox ID="txtID" runat="server" Visible="False"></asp:TextBox>
                <asp:TextBox ID="txtTaiKhoan" runat="server" Width="250px" ReadOnly="True"></asp:TextBox>
                
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtTaiKhoan" ErrorMessage="(*)"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>Mật khẩu: </td>
            <td>
                <asp:TextBox ID="txtMatKhau" runat="server"  Width="250px" TextMode="Password"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>       
        <tr>
            <td>Tên</td>
            <td>
                <asp:TextBox ID="txtRole" runat="server" Visible="False"></asp:TextBox>
                <asp:TextBox ID="txtTen" runat="server"  Width="250px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="txtTen" ErrorMessage="(*)"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>Số điện thoại: </td>
            <td>
                <asp:TextBox ID="txtDienThoai" runat="server"  Width="250px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="txtDienThoai" ErrorMessage="(*)"></asp:RequiredFieldValidator>
            </td>
        </tr>  
        <tr>
            <td>Email </td>
            <td>   
                <asp:TextBox ID="txtEmail" runat="server" Width="250px"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtEmail" ErrorMessage="Không đúng định dạng" 
                    ValidationExpression="^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$"></asp:RegularExpressionValidator>
            </td>
        </tr>   
         <tr>
            <td>Trạng thái: </td>
            <td>
                <asp:CheckBox ID="CheckBox2" runat="server" />
             </td>
            <td></td>
        </tr>
         <tr>
            <td></td>
            <td>
                <asp:Button ID="btnSave" runat="server" Text="Lưu lại" 
                    onclick="btnSave_Click" />
                <asp:Button ID="btnReset" runat="server" Text="Hủy thao tác" 
                    onclick="btnReset_Click" />
            </td>
            <td></td>
        </tr>
    </table>
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" >
    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" 
        oncheckedchanged="CheckBox1_CheckedChanged" Text="Check All" />
    &nbsp;<asp:Button ID="btnAdd" runat="server" Text="Thêm mới" 
        onclick="btnAdd_Click" />
    &nbsp;<asp:Button ID="btnDelete" runat="server" Text="Xóa" 
        onclick="btnDelete_Click" />
    <br />
    <asp:Label ID="lblSuccess" runat="server" ForeColor="#CC0000" 
        Visible="False"></asp:Label>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="ID" DataSourceID="LinqDataSource1" 
        EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" Width="720px">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="cbxCheck" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="Username" HeaderText="Tài khoản" 
                SortExpression="Username" />
            <asp:BoundField DataField="Password" HeaderText="Password" 
                SortExpression="Password" Visible="False" />
            <asp:BoundField DataField="Role" HeaderText="Chức vụ" SortExpression="Role" />
            <asp:BoundField DataField="FullName" HeaderText="Họ và tên" 
                SortExpression="FullName" />
            <asp:BoundField DataField="Phone" HeaderText="Điện thoại" 
                SortExpression="Phone" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:CheckBoxField DataField="Status" HeaderText="Hoạt động" 
                SortExpression="Status" />
            <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="DAL_Class.NLLDataContext" TableName="Administrators" 
        Select="new (ID, Username, Role, Password, FullName, Email, Phone, Status)">
    </asp:LinqDataSource>
</asp:Panel>
</div>
        </div>
    </div>
</div>